package suanfa;

public class HuiWen2Soultion
{

    /**
     * 判断一个整数是否是回文数
     */
    public boolean isPalindrome(int x) {

        if (x < 0 || x % 10 == 0)
        {
            return false;
        }
        int rex = 0;
        while (x>rex)
        {
            rex = rex * 10 + x % 10;
            x = x / 10;
        }
        return (rex ==x||x==rex/10);
    }
}
